﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using ChinaGS.Lian.ModuleRemoting;

public partial class pay_express_confirm_utilities : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        SysCommon.checkUserLogin();

        if (!IsPostBack)
        {
            String cusNo = this.Request["utilities_num"];
            UtilitiesPackage up = RemotingClass.utilitiesBillCheck(cusNo);

            //测试使用
            /*UtilitiesPackage up = new UtilitiesPackage();            
            up.Status = true;
            up.SerialNo = "1234567890";
            up.Message = "success";
            up.StatusNo = "00";

            up.CusNo = cusNo;
            up.CusName = "denveryee";
            up.CusAddress = "qd";
            up.Charge = 10;
            up.RealPay = 0;
            up.ReceiPay = 100;
            up.LastCheckDate = DateTime.Now.ToString("yyyy年MM月dd日");
            up.PayDate = DateTime.Now.ToString("yyyy年MM月dd日");
            up.DueMoney = 10;*/

            if(up.Status){
                if (!up.StatusNo.Equals("00"))
                {
                    //测试使用
                    this.LabMessage.Text = up.Message;
                    //调整内容正式时使用
                    //this.LabMessage.Text = RemotingClass.showErrorMessage(pp.StatusNo);                        
                    PanBill.Visible = false;
                }
                else
                {
                    LabMessage.Text = "尊敬的"+up.CusName+"用户，您的账单信息如下，请确认：";
                    LabCharge.Text = up.Charge.ToString();
                    LabCusAddress.Text = up.CusAddress;
                    LabCusName.Text = up.CusName;
                    LabCusNo.Text = up.CusNo;
                    LabDueMoney.Text = up.DueMoney.ToString();
                    LabLastCheckDate.Text = up.LastCheckDate;
                    LabReceiPay.Text = up.ReceiPay.ToString();

                    HidCharge.Value = up.Charge.ToString();
                    HidCusAddress.Value = up.CusAddress;
                    HidCusName.Value = up.CusName;
                    HidCusNo.Value = up.CusNo;
                    HidDueMoney.Value = up.DueMoney.ToString();
                    HidLastCheckDate.Value = up.LastCheckDate;
                    HidReceiPay.Value = up.ReceiPay.ToString(); 

                }
            }else{
                this.LabMessage.Text = "本次操作失败，错误信息是：" + up.Message + "请稍后重试！";
                PanBill.Visible = false;
                //显示查询失败
            }

        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        Response.Redirect("fill_utilities.aspx?"
                                            + "HidCharge=" + HidCharge.Value.ToString()
                                            + "&HidCusAddress=" + HidCusAddress.Value
                                            + "&HidCusName=" + HidCusName.Value
                                            + "&HidCusNo=" + HidCusNo.Value
                                            + "&HidDueMoney=" + HidDueMoney.Value.ToString()
                                            + "&HidLastCheckDate=" + HidLastCheckDate.Value
                                            + "&HidReceiPay=" + HidReceiPay.Value );
    }
}
